import Todo from './Todo';
import React from 'react';
import { View } from 'react-native';

const TodoList = ({ todos, onTodoClick, onRemoveClick }) => {
  console.log(JSON.stringify(todos), 'TodoList');
  return (
    <View>
      {todos.map((todo, index) => {
        return (
          <>
            <Todo
              key={`bb_${index}`}
              onPress={() => onTodoClick(todo.id)}
              onRemove={() => onRemoveClick(todo.id)}
              {...todo}
            />
          </>
        );
      })}
    </View>
  );
};

export default TodoList;
